Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Deleting Color Lookup Tables

QuickDraw 3D RAVE provides routines that you can use to create and dispose of color lookup tables.

QAColorTableNew

You can use the QAColorTableNew function to create a new color lookup table.

TQAError QAColorTableNew (
                     const TQAEngine *engine,
                     TQAColorTableType tableType,
                     void *pixelData,
                     long transparentIndexFlag,
                     TQAColorTable **newTable);
engine
A drawing engine.
tableType
The type of the new color lookup table. See "Color Lookup Table Types" for information on the available color lookup table types.
pixelData
A pointer to the color lookup table entries.
transparentIndexFlag
A long integer, interpreted as a Boolean value, that indicates whether the color lookup table entry at index 0 is completely transparent ( TRUE ) or not ( FALSE ).
newTable
On entry, the address of a pointer variable. On exit, that variable points to a new color lookup table. If a new color lookup table cannot be created, *newTable is set to the value NULL .

DESCRIPTION

The QAColorTableNew function returns, through the newTable parameter, a new color lookup table associated with the drawing engine specified by the engine parameter. The table entries for the new color lookup table are copied from the block of data pointed to by the pixelData parameter; if QAColorTableNew completes successfully, you can dispose of that block of memory. The data in that block of memory is interpreted according to the format specified by the tableType parameter. For example, if tableType is kQAColorTable_CL8_RGB32 , then pixelData should point to a block of data that is at least 1024 bytes long and in which each 32-bit quantity is an RGB color value.

Currently, QuickDraw 3D RAVE supports only 32-bit RGB color lookup table entries. The specified drawing engine might reduce the size of individual color lookup table entries to fit into its on-board memory.

Not all drawing engines support color lookup tables, and QuickDraw 3D RAVE does not provide color lookup table emulation for engines that do not support them.

SEE ALSO

Use the QAColorTableDelete function (next) to delete a color lookup table. Use the QATextureBindColorTable function [link] to bind a color lookup table to a texture map. Use the QABitmapBindColorTable function [link] to bind a color lookup table to a bitmap.

QAColorTableDelete

You can use the QAColorTableDelete function to delete a color lookup table.

void QAColorTableDelete (
                     const TQAEngine *engine,
                     TQAColorTable *colorTable);
engine
A drawing engine.
colorTable
A color lookup table.

DESCRIPTION

The QAColorTableDelete function deletes the color lookup table specified by the colorTable parameter. Any memory and other resources associated with that color lookup table are released.

SEE ALSO

Use the QAColorTableNew function [link] to create a color lookup table.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |